from rest_framework import serializers
from .models import *


class CategorySer(serializers.ModelSerializer):
    class Meta:
        model = Category
        fields = "__all__"


class GoodsSer(serializers.ModelSerializer):
    cate = CategorySer()

    class Meta:
        model = Goods
        fields = "__all__"


class GoodsListSer(serializers.ModelSerializer):
    class Meta:
        model = Goods
        fields = ["id", "name", "price", "pic"]
